<template>
  <div style="width: 100%;height:100%">
    <el-row>
      <el-card class="box-card" style="width: 95%; min-height:100px;margin:0 auto">
        <div style="font-size: 30px;height:20px;">
          <B>
            <center>信息统计</center>
          </B>
        </div>
      </el-card>
    </el-row>
    <br />
    <el-row>
      <el-card class="box-card" style="width: 95%; min-height:580px;margin:0 auto">
        <el-col :span="11">
          <br />
          <br />
          <div style="width:450px;height:450px;margin:0 auto;" ref="bar"></div>
        </el-col>
        <el-col :span="11" :offset="2"></el-col>
      </el-card>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data1:""
    };
  },
  methods: {
    queryAckType() {
      this.$axios.get("api/custom-server/chat/queryAckType").then(res => {
        this.data1 = res.data.data;
      });
    },
    echartsInit() {
      debugger;
      var myChart = this.$echarts.init(this.$refs.bar);
      var option = {
        title: {
          text: "咨询类型",
          subtext: "Fake Data",
          left: "center"
        },
        tooltip: {
          trigger: "item"
        },
        legend: {
          orient: "vertical",
          left: "left"
        },
        series: [
          {
            name: "类型",
            type: "pie",
            radius: "50%",
            data: this.data1,
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)"
              }
            }
          }
        ]
      };
      myChart.setOption(option);
    }
  },
  created() {
    this.queryAckType()
  },
  mounted() {
    setTimeout(() => {
      this.echartsInit();
      // this.echartsInit2();
    }, 500);
    window.vue = this;
  }
};
</script>

<style>
</style>